diff options
| author | Martin Kagamino Lehoux <martin@lehoux.net> | 2026-07-27 21:07:48 +0200 |
|---|---|---|
| committer | Martin Kagamino Lehoux <martin@lehoux.net> | 2026-07-27 21:07:48 +0200 |
| commit | d9a200cd35a3d06173846a45c9f58acb1adf61aa (patch) | |
| tree | 35f972193cc7ef7984705c61cd8b6f2aa48ff60e /src/routes/grocery/[id]/+page.server.ts | |
| parent | bc3678461c3000c2394e355b7aaa73b774a33fff (diff) | |
refactor: rename brand to reference everywhere
Diffstat (limited to 'src/routes/grocery/[id]/+page.server.ts')
| -rw-r--r-- | src/routes/grocery/[id]/+page.server.ts | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/src/routes/grocery/[id]/+page.server.ts b/src/routes/grocery/[id]/+page.server.ts index 88aa137..e434e9f 100644 --- a/src/routes/grocery/[id]/+page.server.ts +++ b/src/routes/grocery/[id]/+page.server.ts @@ -34,18 +34,18 @@ export const load: PageServerLoad = async ({ params }) => { export const actions: Actions = { add: async ({ request, params }) => { const data = await request.formData(); - const brand = data.get('brand')?.toString().trim(); + const reference = data.get('reference')?.toString().trim(); const price = data.get('price')?.toString().trim(); const unit = data.get('unit')?.toString().trim(); const qualityScore = data.get('quality_score')?.toString().trim(); - if (!brand) { - return fail(400, { error: 'Brand is required' }); + if (!reference) { + return fail(400, { error: 'Reference is required' }); } await db.insert(references).values({ groceryId: Number(params.id), - brand, + reference, price: price ? Number(price) : null, unit: unit || null, qualityScore: qualityScore ? Number(qualityScore) : null, |
